import request from '@/utils/request'

// 查询列表
export function fetchNoticeList() {
  return request({
    url: '/admin/notices',
    method: 'get'
  })
}

// 查询单条
export function fetchNotice(id) {
  return request({
    url: `/admin/notices/${id}`,
    method: 'get'
  })
}

// 创建
export function createNotice(data) {
  return request({
    url: '/admin/notices',
    method: 'post',
    data
  })
}

// 修改
export function updateNotice(id, data) {
  return request({
    url: `/admin/notices/${id}`,
    method: 'put',
    data
  })
}

// 删除
export function deleteNotice(id) {
  return request({
    url: `/admin/notices/${id}`,
    method: 'delete'
  })
}
